#include <bits/stdc++.h>
using namespace std;
const int N = 2e4 + 10;
int n;
int main() {
    // freopen("in.in", "r", stdin);
    while(cin >> n) {
        if(n == 0) {
            break;
        }
        int a[N];
        int visit[N];
        memset(visit, 0, sizeof(visit));
        for(int i = 1; i <= n; i++) {
            cin >> a[i];
            if(visit[a[i]] == 0) {
                cout << a[i] << " ";
            }
            visit[a[i]] = 1;
        }
        cout << endl;
    }
    return 0;
}